/**
 * Created by shc@lierda.com on 2016/7/4.
 */
var React = require('react');

module.exports = React.createClass({
    getInitialState: function () {
        return {
            type: "loading",
            word: "正在提交",
            show: false,
            timeout: 0
        }
    },
    componentDidUpdate: function () {
        if (this.state.timeout > 0) {
            var p = this;
            setTimeout(function(){
                p.setState({show: false, timeout: 0});
            },p.state.timeout)
        }
    },
    render: function () {
        return (
            <div className={this.state.show ? "lsd-msg-container" : "lsd-msg-container hide"}>
                <div className="lsd-msg-box">
                    {this.state.type == "loading" ? "" : <div>{this.state.word}</div>}
                </div>
            </div>
        );
    }
});
